﻿using Lidgren.Network;

namespace Network.Messages.FileTranser
{
    public class ResponseEndCopyFileMessage : NovaMessage
    {
        /// <summary>
        /// 用于唯一标识的标签
        /// </summary>
        public uint Number;

        /// <summary>
        /// 源文件路径，服务端
        /// </summary>
        public string SourceFile;

        /// <summary>
        /// 粘贴临时路径，客户端
        /// </summary>
        public string DestFile;
        public ResponseEndCopyFileMessage() :
            base((ushort) CustomMessageType.ResponseEndCopyFile)
        {
        }

        public override void WritePayload(NetOutgoingMessage message)
        {
            base.WritePayload(message);
            message.Write(Number);
            message.Write(SourceFile);
            message.Write(DestFile);
        }

        public override void ReadPayload(NetIncomingMessage message)
        {
            base.ReadPayload(message);
            Number = message.ReadUInt32();
            SourceFile = message.ReadString();
            DestFile = message.ReadString();
        }
    }
}